package com.controller;

import com.dto.HttpClientMapResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.net.HttpURLConnection;
import java.util.Map;

@RestController
@RequestMapping("/error")
public class ErrorController {

    @RequestMapping(value = "/Authorization", method = {RequestMethod.GET, RequestMethod.POST})
    public Map errorAuthorization() {
        return new HttpClientMapResult(HttpURLConnection.HTTP_UNAUTHORIZED).putErrMsg("认证失败");
    }

}
